package com.mall.service.citylife;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.mall.client.citylife.CitylifeCompanyPayInfoService;
import com.mall.custom.dao.read.CitylifeCompanyPayInfoReadMapper;
import com.mall.pojo.CitylifeCompanyPayInfo;
import com.mall.pojo.CitylifeCompanyPayInfoExample;
import com.mall.pojo.CitylifeCompanyPayInfoExample.Criteria;

public class CitylifeCompanyPayInfoServiceImpl implements CitylifeCompanyPayInfoService {

	@Autowired
	private CitylifeCompanyPayInfoReadMapper citylifeCompanyPayInfoReadMapper;

	@Override
	public List<CitylifeCompanyPayInfo> getMallCompanyPayInfoListByTypeAndCity(int commOnlyKey, int type) {
		CitylifeCompanyPayInfoExample example = new CitylifeCompanyPayInfoExample();
		Criteria criteria = example.createCriteria();
		criteria.andCommOnlyKeyEqualTo(commOnlyKey);
		criteria.andTypeEqualTo(type);
		return citylifeCompanyPayInfoReadMapper.selectByExample(example);
	}

	@Override
	public CitylifeCompanyPayInfo getMallCompanyPayInfoById(Long id) {
		return this.citylifeCompanyPayInfoReadMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Integer> getDistinctTypeFromCommOnlyKey(int commOnlyKey) {
		return this.citylifeCompanyPayInfoReadMapper.getDistinctTypeFromCommOnlyKey(commOnlyKey);
	}

}
